#include <cmath>
#include <cstdio>
double a, eps = 1e-7;
inline double f(double x) {
	return pow(x, a / x - x);
}
inline double integ(double l, double r) {
	return (f(l) + 4 * f((l + r) / 2) + f(r)) * (r - l) / 6;
}
inline double sim(double l, double r, double tmp) {
	double mid = (l + r) / 2;
	double la = integ(l, mid), ra = integ(mid, r);
	if (fabs(la + ra - tmp) < 15 * eps) return (la + ra + (la + ra - tmp) / 15);
	return sim(l, mid, la) + sim(mid, r, ra);
}
int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
	freopen("testdata.in", "r", stdin);
	freopen("testdata.out", "w", stdout);
#endif
#ifndef LOCAL
	freopen("Simpson Integration2.in", "r", stdin);
	freopen("Simpson Integration2.out", "w", stdout);
#endif
#endif

	scanf("%lf", &a);
	if (a < 0) {
		printf("orz");
		return 0;
	}
	printf("%.5lf", sim(eps, 15, integ(eps, 15)));
	return 0;
}